﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Manager.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="B2B.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">


</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HEAD" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="main_content" runat="server">

     <script type="text/javascript"> 
        
         function loadDanhMuc(maLinhVuc)
         {
             if (maLinhVuc != 0) {
                 $.getJSON("/Home/DanhSachDanhMuc?id=" + maLinhVuc,
                  function (data) {
                      document.getElementById("divDanhMuc").innerText = "";
                      var s = '';
                      s += "<select id='MaDanhMuc'>";
                      for (i = 0 ; i < data.length; i++) {
                          s += "<option value='" + data[i].MaDanhMuc + "'>" + data[i].TenDanhMuc + "</option>";
                      }
                      s += "</select>";
                      $("#divDanhMuc").html(s);
                  });
             }
             else
             {
             }
         }

       

    </script>
   

     <h6> Management -> Product -> Update</h6>
    
    <table border="1">
        <tr>
            <td colspan="2"><center style="font-size:20px">Update Product</center></td>
        </tr>
        <tr>
            <th>Product Name:</th>
            <td><input type="text" name="tenSP" /> </td>
        </tr>
        <tr>
            <th>Image</th>
            <td>
                <img src="../../Images/Alibaba/Digital_camera_2.jpg" /><br />
                <input type="file" name="fileUpload" />
            </td>
        <//tr>
        <tr>
            <th>Price</th>
            <td><input type="text" name="gia" /></td>
        </tr>
        <tr>
            <th>Min .Order</th>
            <td><input type="text" name="soLuongDatToiThieu" /></td>
        </tr>
        <tr>
            <th>Suppli </th>
            <td><input type="text" name="khanangcungung" /></td>
        </tr>
        <tr>
            <th>Payment type</th>
            <td><input type="text" name="loaiThanhToan" />
                <input type="button" value="insert" />
                <div id="divPaymentYype"></div>
            </td>
        </tr>
        <tr>
            <th>Country</th>
            <td>
                <select>
                    <option>VietName</option>
                    <option>United State</option>
                    <option>English</option>
                    <option>France</option>
                    <option>China</option>
                </select>
            </td>
        </tr>
        <tr>
              <th style="width: 280px; height: 62px;">Product Category: </th>
                        <!--Tu viet group box bang javascript de chon muc mua hang-->
                <td style="width: 228px; height: 62px;">
                    <select ID="selProductCategory">
                          <option value="0" selected="selected">--Please select category--</option>
                          <%foreach(var lv in (ArrayList)ViewData["linhvuc"]) 
                           {%>                             
                               <option onclick="loadDanhMuc('<%=((LinhVuc)lv).MaLinhVuc.ToString() %>')" value="<%=((LinhVuc)lv).MaLinhVuc.ToString() %>"><%=((LinhVuc)lv).TenLinhVuc.ToString() %></option>
                          <%}%>
                     </select>
                     <div id="divDanhMuc"></div>
               </td>                       
       </tr>
        <tr>
            <td><input type="submit" value="Update" /></td>
        </tr>
      

    </table>
</asp:Content>
